import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    curCity: '特殊车型123',
    isLogin: false,
    userInfo: {
      avatarUrl: '',
      city: '',
      gender: '',
      nickName: '',
      province: ''
    }
  },
  mutations: {
    updateCity: (state, change) => {
      state.curCity = change
    },
    updateIsLogin: (state, change) => {
      state.isLogin = change
    },
    cleanUserInfo: (state) => {
      state.userInfo = {
        avatarUrl: '',
        city: '',
        gender: '',
        nickName: '',
        province: ''
      }
    }
  }
})
export default store
